﻿/*
 * Cache.cs
 *
 * Created on November 17, 2007, 4:38 PM
 *
 * Copyright (C) 2007-2008  Hylke van der Schaaf
 * Copyright (C) 2010       Mathijs Miermans
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, in version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Collections.Generic;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace HexTD.util
{
	public class Cache
	{

		private Dictionary<string, Image[]> cBufImgArr;
		private Dictionary<string, Shape[]> cShapeArr;
		private Dictionary<string, Shape> cShape;

		/** Creates a new instance of Cache */
		public Cache()
		{
			this.cBufImgArr = new Dictionary<string, Image[]>();
			this.cShapeArr = new Dictionary<string, Shape[]>();
			this.cShape = new Dictionary<string, Shape>();
		}

		public void clearCache()
		{
			this.cBufImgArr.Clear();
			this.cShapeArr.Clear();
			this.cShape.Clear();
		}


		public bool hasBufImgArr(string name)
		{
			return this.cBufImgArr.ContainsKey(name);
		}
		public void putBufImgArr(string name, Image[] a)
		{
			this.cBufImgArr.Add(name, a);
		}
		public Image[] getBufImgArr(string name)
		{
			return this.cBufImgArr[name];
		}


		public bool hasShapeArr(string name)
		{
			return this.cShapeArr.ContainsKey(name);
		}
		public void putShapeArr(string name, Shape[] a)
		{
			this.cShapeArr.Add(name, a);
		}
		public Shape[] getShapeArr(string name)
		{
			return this.cShapeArr[name];
		}


		public bool hasShape(string name)
		{
			return this.cShape.ContainsKey(name);
		}
		public void putShape(string name, Shape a)
		{
			this.cShape.Add(name, a);
		}
		public Shape getShape(string name)
		{
			return this.cShape[name];
		}
	}
}
